<?php defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="canceler hidden">
</div>
<div id="com_docario">
    <div id="col100">
        <table cellspacing="0" cellpading="0" border="0" width="100%">
            <tr><td valign="top">
                <fieldset class="adminForm" width="100%">
                    <legend><?php echo JText::_('GROUP_DATA'); ?></legend>
                    <table class="adminForm"><tbody>
                        <tr>
                            <td width="100" align="right" class="key">
                                <legend for="group_name">
                                    <?php echo JText::_('NAME'); ?>
                                </legend>
                            </td>
                            <td>
                                <input type="text" name="group_name" id="group_name" 
                                       value="<?php echo $this->group->name; ?>" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100" align="right" class="key">
                                <legend for="group_description">
                                    <?php echo JText::_('DESCRIPTION'); ?>
                                </legend>
                            </td>
                            <td>
                                <input type="text" name="group_description"
                                       id="group_description"
                                       value="<?php echo $this->group->description; ?>" />
                            </td>
                        </tr>
                    </tbody></table>
                </fieldset>
            </td></tr>
        </table>
    </div>
    <div class="col010">
        <h2><?php echo JText::_('GROUP_MEMBERS'); ?></h2>
        <?php if ($this->group->id > 0) { ?>
        <div class="usersearch_area">
            <div class="input_container">
                <label for="usersearch"><?php echo JText::_('SEARCH'); ?></label>
                <input type="text" name="usersearch" id="usersearch" value="" />
            </div>
            <div id="searchresults" class="hidden">
            </div>
        </div>
        <div class="members">
            <table class="docariotable">
                <?php $k = 0; foreach ($this->members as $member) { ?>
                <tr class="row<?php echo $k; ?>">
                    <td><?php echo $member->username; ?></td>
                    <td width="20">
                        <?php if ($member->administrator) { ?>
                            <a href="<?php echo JRoute::_('index.php?option=com_docario&controller=group&task=adminOff&gid='.$this->group->id.'&uid='.$member->id); ?>">
                            <img src="<?php echo 'components'.DS.'com_docario'.DS.'assets'.DS.'images'.DS.'admin.png'; ?>" />
                            </a>
                        <?php } else { ?>
                            <a href="<?php echo JRoute::_('index.php?option=com_docario&controller=group&task=adminOn&gid='.$this->group->id.'&uid='.$member->id); ?>">
                            <img src="<?php echo 'components'.DS.'com_docario'.DS.'assets'.DS.'images'.DS.'user.png'; ?>" />
                            </a>
                        <?php } ?>
                    </td>
                    <td width="70">
                        <a href="<?php echo JRoute::_('index.php?option=com_docario&controller=group&task=removeUser&gid='.$this->group->id.'&uid='.$member->id); ?>">
                        <img src="<?php echo  'components'.DS.'com_docario'.DS.'assets'.DS.'images'.DS.'list-remove.png'; ?>" />
                        <?php echo JText::_('REMOVE'); ?>
                        </a>
                    </td>
                </tr>
                <?php $k = 1 - $k; } ?>
            </table>
        </div>
        <?php } else { ?>
            <?php echo JText::_('TO_EDIT_MEMBERS_GROUP_MUST_BE_SAVED'); ?>
        <?php } ?>
    </div>
</div>

<input type="hidden" name="id" id="id" value="<?php echo $this->group->id; ?>" />

<input type="hidden" name="option" id="option" value="com_docario" />
<input type="hidden" name="controller" id="controller" value="group" />
<input type="hidden" name="task" id="task" value="" />

<input type="hidden" name="baseurl" id="baseurl" value="<?php echo JURI::base(); ?>" />

</form>
